using System;
using System.Drawing;
using System.Collections;

using Game.Input.GUI;
using Game.Output;

namespace Game.Input
{
	public static class CCommands
	{
		public enum CmdID 
		{
			ADD_TILE	= 0,
			OPEN_MENU	= 1
		}
		
		public struct structCmd
		{
			public CmdID	cmdID;
			public Point	tileCoords;
			public Point	screenCoords;
			public int		param1;
		}
		
		private static ArrayList m_commands;
			
		public static void Initialize()
		{
			CConsole.ReportClassInit(System.Reflection.MethodInfo.GetCurrentMethod().DeclaringType.Name);
			
			m_commands = new ArrayList();
		}
		
		public static void Add(
			CmdID	cmdID,
			Point	tileCoords,
			Point	screenCoords,
			int		param1
		) {
			structCmd newCmd;
			
			newCmd.cmdID		= cmdID;
			newCmd.tileCoords	= tileCoords;
			newCmd.screenCoords	= screenCoords;
			newCmd.param1		= param1;
			
			m_commands.Add(newCmd);
			
			CConsole.ReportProcess("New Command added: " + cmdID + " Tile-Coords: " + tileCoords + " Param1: " + param1);
		}
		
		public static void Execute()
		{
			int index = 0;
			
			foreach (structCmd cmd in m_commands)	
			{
				CConsole.ReportProcess("Processing #" + index + " Cmd-ID: " + cmd.cmdID + " Tile-Coords: " + cmd.tileCoords + " Param1: " + cmd.param1);		
				
				switch (cmd.cmdID)
				{
					case CmdID.ADD_TILE:
//						CStreets.Add(cmd.TileCoords, CTilesets.ID.TWO, cmd.Param1);
						break;
				}
				
				index++;
			}
			
			m_commands.Clear();
		}
		
	}
}
